﻿using Gardener.Application.Dtos;
using Gardener.Application.Interfaces;
using Gardener.Client.Models;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Gardener.Client.Services
{
    public class SourceService : ApplicationServiceBase<SourceDto, Guid>, ISourceService
    {
        private readonly static string controller = "resource";
        private readonly IApiCaller apiCaller;

        public SourceService(IApiCaller apiCaller) : base(apiCaller, controller)
        {
            this.apiCaller = apiCaller;
        }

        public async Task<List<SourceDto>> GetAll(string username)
        {
            return await apiCaller.GetAsync<List<SourceDto>>($"/api/file/request-file-dir/{username}");
        }
    }
}
